rename var1 id
rename var2 user_id
rename var3 block
rename var4 prior_A
rename var5 number
rename var6 true_state
rename var7 chosen_act

gen qid=1
replace qid=2 if prior_A>0.5

gen correct=0
replace correct=1 if true_state==chosen_act




gen response=0
replace response=1 if chosen_act==1





gen state_2_DP_5=0
replace state_2_DP_5=1 if true_state==2 & qid==1
gen state_1_DP_6=0
replace state_1_DP_6=1 if true_state==1 & qid==2
gen state_2_DP_6=0
replace state_2_DP_6=1 if true_state==2 & qid==2


reg response state_2_DP_5 state_1_DP_6 state_2_DP_6, cluster(user_id)


logit response state_2_DP_5 state_1_DP_6 state_2_DP_6, cluster(user_id)